package com.webSite.demo.cy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.webSite.demo.cy.bean.HomeYeWu;

@Mapper
public interface HomeYeWuMapper  extends BaseMapper<HomeYeWu>{

	@Select(value="select * from home_yewu where state =1")
	List<HomeYeWu> findAllInfo();
	
	@Select(value="select * from home_yewu where id=#{0}")
	HomeYeWu findOne(int id);
	
	@Insert(value="insert into home_yewu(title, content, state, created, updated) value(#{title},#{content},#{state},#{created},#{updated})")
	int insertHomeYeWu(HomeYeWu homeNews);
	
	@Update(value="update home_yewu set title=#{title},content=#{content},updated=#{updated} where id=#{id}")
	int updateHomeYeWu(HomeYeWu homeNews);
	
	@Update(value="update home_yewu set state=0 where id=#{0}")
	int updateState(int id);
}
